package cn.matezk.things.broker.mapper;

import cn.matezk.things.broker.mode.Device;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface DeviceMapper {
    @Insert("insert into t_device(id, product_id, device_name, device_id, device_secret, reported) values(#{id}, #{productId}, #{deviceName}, #{deviceId}, #{deviceSecret}, '{}')")
    int insert(Device device);
    @Select("select product_id, device_name from t_device where product_id = #{productId} and device_name = #{deviceName}")
    Device select(@Param("productId") String productId, @Param("deviceName") String deviceName);
}
